0 was used as an "unset" flag for tmp_dir_fd, which is technically
incorrect. For cache_dir_fd, -1 was used as the sentinal but 0
was checked for, resulting in close(-1).
Closes: #507
Approved by: cgwalters
g_free (self->commit_stagedir_name);
glnx_release_lock_file (&self->commit_stagedir_lock);
g_clear_object (&self->tmp_dir);
- if (self->tmp_dir_fd)
+ if (self->tmp_dir_fd != -1)
(void) close (self->tmp_dir_fd);
- if (self->cache_dir_fd)
+ if (self->cache_dir_fd != -1)
(void) close (self->cache_dir_fd);
if (self->objects_dir_fd != -1)
(void) close (self->objects_dir_fd);
self->repo_dir_fd = -1;
self->cache_dir_fd = -1;
+ self->tmp_dir_fd = -1;
self->commit_stagedir_fd = -1;
self->objects_dir_fd = -1;
self->uncompressed_objects_dir_fd = -1;